<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>系统管理页</title>
    <link type="text/css" rel="Stylesheet" href="/styles/default.css" />
    <script src="/cdn/=org.jside:*"></script>
  </head>
  <body>
    <h2>开启调试选项</h2>
    <input type="button" onclick="openDebug()" value="开启调试标记" id="openHandle"/>
    <input type="button" onclick="closenDebug()" value="关闭调试标记" id="closeHandle"/>
    <script>
    //<![CDATA[
    var serverToken = "${CDN_DEBUG}";
    var cookie = new Cookie("CDN_DEBUG");
    function openDebug(){
    	cookie.set(serverToken);
    	initialize();
    }
    function closenDebug(){
    	cookie.remove();
    	initialize();
    }
    function initialize(){
    	var token = cookie.get();
    	var opened = (token == serverToken);
    	if(!opened && token){
    		confirm("Token已过期")
    		cookie.remove();
    	}
        E('openHandle').disabled=opened;
        E('closeHandle').disabled=!opened;
    }
    setInterval(initialize,1000);
    initialize();
    //]]>
    </script>
  </body>
</html>
